import { extend } from 'vee-validate'
import { required } from 'vee-validate/dist/rules'

extend('phoneRequired', {
  ...required,
  message: '请输入手机号',
})
const phoneReg = /^1[3-9][0-9]{9}$/
extend('phone', {
  validate(phone) {
    return phoneReg.test(phone)
  },
  message: '请输合法入手机号',
})
extend('passwordRequired', {
  ...required,
  message: '请输入密码',
})
extend('password', {
  validate(password) {
    const reg = /^[0-9]{6,18}$/
    return reg.test(password)
  },
  message: '密码不得少于6位',
})
